package com.zzccyy.jpdemo.utils;

import com.prolificinteractive.materialcalendarview.CalendarDay;
import com.prolificinteractive.materialcalendarview.format.DayFormatter;

public class TodayDayFormatter implements DayFormatter {

    @Override
    public String format(CalendarDay day) {
        // 获取今天的日期
        CalendarDay today = CalendarDay.today();

        // 判断是否为今天且年月相同
        if (day.getYear() == today.getYear()
                && day.getMonth() == today.getMonth()
                && day.getDay() == today.getDay()) {
            return "今天";
        } else {
            // 其他日期显示默认天数
            return String.valueOf(day.getDay());
        }
    }
}